<script lang="ts">
	import { appStore } from '$lib/stores/app.svelte';

	let { children } = $props();

	window.addEventListener('unhandledrejection', function (event) {
		event.preventDefault();
		appStore.addToastMessage({
			level: 'error',
			content: `${event}`,
			keepTime: 2000
		});
	});
</script>

{@render children()}
